package com.kgc.springboot.hangduo.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author: ASUS
 * @date: 2020/12/11 10:02
 * @description:
 */
@Configuration
public class SpringMvcConfig implements WebMvcConfigurer {

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/").setViewName("user/login");
        registry.addViewController("/tologin.html").setViewName("login");
        registry.addViewController("/tologin").setViewName("login");
        registry.addViewController("/welcome.html").setViewName("welcome");
        registry.addViewController("/myinformation.html").setViewName("myinformation");
        registry.addViewController("/mypassword.html").setViewName("mypassword");
        registry.addViewController("/business.html").setViewName("business");
        registry.addViewController("/my.html").setViewName("my");
        //registry.addViewController("/law-list.html").setViewName("law-list");
        //registry.addViewController("/mulu-list.html").setViewName("mulu-list");
        registry.addViewController("/terms-list.html").setViewName("terms-list");
        registry.addViewController("/member-list.html").setViewName("member-list");
        registry.addViewController("law-add.html").setViewName("law-add");
        registry.addViewController("law-update.html").setViewName("law-update");
        //registry.addViewController("/member-list.html").setViewName("member-list");
        registry.addViewController("/user-index.html").setViewName("user-index");
//        registry.addViewController("/hudong.html").setViewName("/user/hudong");
        registry.addViewController("/user.html").setViewName("/user/user");
        registry.addViewController("/login.html").setViewName("/user/login");
        registry.addViewController("/register.html").setViewName("/user/register");
        registry.addViewController("/user-aboutus").setViewName("/user-aboutus");
        registry.addViewController("/user-clause-list.html").setViewName("/user-clause-list");

    }
//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(new LoginHandlerInterceptor()).addPathPatterns("/**").excludePathPatterns("/login.html","/","/tologin","/webjars/**",
//                "/css/**","fonts/**","/images/**","/js/**","/lib/**","/userlogin","/tologin.html","/law-list.html","/mulu-list.html","/member-list.html",
//                "admin-add.html","/client/**","/user-index.html");
//    }
}
